<?php 
$docRoot = $_SERVER['DOCUMENT_ROOT'].'/'.strtok($_SERVER['PHP_SELF'], '/');
include_once ($docRoot."/application/service/feed/loader/impl/TeamLoaderImpl.php");
include_once ($docRoot."/application/service/feed/loader/impl/TournamentLoaderImpl.php");
include_once ($docRoot."/application/service/feed/loader/impl/CountryLoaderImpl.php");
include_once ($docRoot . "/application/config/site_config.php");
?>

<?php

//Catch All Request Parameters
$adminAction = $_REQUEST["adminFeedAction"];

	if ($adminAction == "teamFeed"){
		$rostersFeedUrl = $_REQUEST["rostersFeedUrl"];
		$startsFeedUrl = $_REQUEST["statsFeedUrl"];
		
		$teamLoader = new TeamLoaderImpl();
		$teamLoader->setRostersFeedUrl($rostersFeedUrl);
		$teamLoader->setStatsFeedUrl($startsFeedUrl);
		
        $teamLoader->setRostersFeedXml($teamRostersXmlName);
        $teamLoader->setStatsFeedXml($teamStatsXmlName);
        $teamLoader->setFeedTeamXmlPath($teamXMLFeed);
		
		$teamLoader->loadFeed();
	}

	if ($adminAction == "tournamentFeed")
	{
		$tournamentFeedUrl = $_REQUEST["tournamentFeedUrl"];
		
		$tournamentFeedLoader = new TournamentLoaderImpl();
		$tournamentFeedLoader->setTournamentFeedUrl($tournamentFeedUrl);
		$tournamentFeedLoader->setFeedLocalPath($tournamentXMLFeedLocalPath);
		$tournamentFeedLoader->setFeedLocalXmlName($tournamentLocalXmlName);
		
		$tournamentFeedLoader->loadFeed();
		
	}
	
	
	if ($adminAction == "countryFeed")
	{
		$countryFeedUrl = $_REQUEST["countryFeedUrl"];
		$standingsFeedUrl = $_REQUEST["standingsFeedUrl"];
		$sheduleFeedUrl =$_REQUEST["sheduleFeedUrl"];
		
		$countryFeedLoader = new CountryLoaderImpl();
		$countryFeedLoader->setCountryFeedUrl($countryFeedUrl);
		$countryFeedLoader->setStandingsFeedUrl($standingsFeedUrl);
		$countryFeedLoader->setSheduleFeedUrl($sheduleFeedUrl);
		
		$countryFeedLoader->setCountryFeedXmlName($countryLocalXmlName);
		$countryFeedLoader->setSheduleFeedXmlName($countrySheduleLocalXmlName);
		$countryFeedLoader->setStandingsFeedXmlName($countryStandingsLocalXmlName);
		
		$countryFeedLoader->setCountryFeedLocalPath($countryXMLFeedLocalPath);
		
		$countryFeedLoader->loadFeed();
		
		
	}
	
?>